Inner tab strip (Tabs within tabs)

My previous message seems to have been deleted or cannot be displayed properly by the forum. Therefore, I am posting a solution to the inner tab problem I was facing as requested by Louie. I am sure this will help others who are trying to get this working.

For ethical reasons I will not post all my library include files but will only show the proof of concept.
 

string tabStrings[] = {mainTab_label, helpTab_label}
    string tabStringsSUB[] = {"MainSub 1", "MainSub 2"}
 
        //Outer tab
        dbe_theTab = tab(db, tabStrings, 700, 500, tab_cb_Local)
        dbe_theTab->"top"  ->"flush"->smartDxlBanner
        dbe_theTab->"left" ->"form"
        dbe_theTab->"right"        ->"form"
        dbe_theTab->"bottom"->"form"
        
        //Inner tab
        DBE dbe_theTab_inner = tab(db, tabStringsSUB, 600, 300, tab_inner_cb_Local)
        put(skip_FrameMain, dbe_theTab_inner, dbe_theTab_inner)
        dbe_theTab_inner->"top"    ->"inside"->dbe_theTab
        dbe_theTab_inner->"left"->"inside"->dbe_theTab
        dbe_theTab_inner->"right"->"inside"->dbe_theTab
        dbe_theTab_inner->"bottom"->"inside"->dbe_theTab
        
        setParent(dbe_theTab_inner, dbe_theTab) // (child, parent)
        //frame creation for each tab
        //dbe_FrameMain = frame(db, "", 100, 100)
        
        DBE dbe_textbox_inner = richText(db, "", "", 100, 75, false)
        put(skip_Frame_sub1, dbe_textbox_inner, dbe_textbox_inner)                                              //Place DBE onto the proper frame skip list (in order to isolate the DBE and have it display in the appropriate frame)
        dbe_textbox_inner->"top"   ->"inside"->dbe_theTab_inner
        dbe_textbox_inner->"left"  ->"inside"->dbe_theTab_inner
        dbe_textbox_inner->"right" ->"inside"->dbe_theTab_inner
        dbe_textbox_inner->"bottom"        ->"inside"->dbe_theTab_inner
        
        // VERY IMPORTANT, the setParent must be set on the inner elements of the inner tab
        setParent(dbe_textbox_inner, dbe_theTab_inner) // (child, parent)
 
        
        
        DBE FrameResponsibility = frame(db, "Inner sub 2", 175, 125)
        put(skip_Frame_sub2, FrameResponsibility, FrameResponsibility)                                          //Place DBE onto the proper frame skip list (in order to isolate the DBE and have it display in the appropriate frame)
        FrameResponsibility->"top" ->"inside"->dbe_theTab_inner
        FrameResponsibility->"left"        ->"inside"->dbe_theTab_inner
        FrameResponsibility->"right"       ->"inside"->dbe_theTab_inner
        FrameResponsibility->"bottom"      ->"inside"->dbe_theTab_inner
        setParent(FrameResponsibility, dbe_theTab_inner) // (child, parent)
        
        
        dbe_FrameHelp = frame(db, "", 100, 75)
        put(skip_FrameHelp, dbe_FrameHelp, dbe_FrameHelp)
        dbe_FrameHelp->"left"      ->"inside"->dbe_theTab
        dbe_FrameHelp->"right"     ->"inside"->dbe_theTab
        dbe_FrameHelp->"top"       ->"inside"->dbe_theTab
        dbe_FrameHelp->"bottom"    ->"unattached"//"inside"->dbe_theTab  
        
        
        // Bottom button declarations (translated in french and english)
        string apply_label = get_dbe_tooltype_label(skip_dictionary_values, "languageGUI", "dbe_apply_button")
        apply(db, apply_label, go) // Apply button at the bottom of the form that will start the "go" function
        
        close_label = get_dbe_tooltype_label(skip_dictionary_values, "languageGUI", "dbe_close_button")
        ok(db, close_label, callback_specific_close)                            // Rename the close button depending on french/english (To rename the close you must have an OK followed by a close while having a false as the second param of the close button)
        close(db, false, callback_specific_close)
 
        
        /**TODO Create elements in your main tab**/     
        //createMainFrame(dbe_FrameMain)
        
        
        // Create Dialog Box Elements (DBE)  
        createHelpFrame(dbe_FrameHelp)
        
        
        //skipTabs is declared in tabs.inc
        put(skipTabs, 0, skip_FrameMain)  // key must match the tab index returned by get(dbe_theTab)
        put(skipTabs, 1, skip_FrameHelp)
        
        put(skipTabsInner, 0, skip_Frame_sub1)  // key must match the tab index returned by get(dbe_theTab)
        put(skipTabsInner, 1, skip_Frame_sub2)
        
        
        
        set(dbe_theTab, 0)
        set(dbe_theTab_inner, 0)
        
        showSelected(0)
        //showSelectedInner(0)
 
        realize db

 


The import part is to set the parent of the inner elements to the inner tab which is itself a child of the outer tab. I do not yet know how far down I will have to setParents for.

Attached is my tabs.inc which is used to display the correct skips or hide them accordingly with the selected tab (outer or inner).

Get it? got it? GOOD !

Patrick

 


PatrickGuay - Thu Jun 07 09:56:41 EDT 2012